<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>slice</title>
</head>
<body>
<script>
    var arr = ["a", "b", "c", "d", "e", "f"];

    var result1 = arr.slice(2);
    var result2 = arr.slice(-2);
    var result3 = arr.slice(2, 4);
    var result4 = arr.slice(4, 2);

    console.log("arr:" + JSON.stringify(arr));
    console.log("result1:" + JSON.stringify(result1));
    console.log("result2:" + JSON.stringify(result2));
    console.log("result3:" + JSON.stringify(result3));
    console.log("result4:" + JSON.stringify(result4));
</script>
</body>
</html>